package desmontecles

import desmontec.documentos.DpgService;
import desmontec.sistema.SecUserService;
import desmontec.aluguel.AluguelMaquinaService;
import desmontec.alertas.AlertaMaquinaService;

class ExpiraDPGValidadeJob {
	
	DpgService dpgService
	SecUserService secUserService
	AlertaMaquinaService alertaMaquinaService
	AluguelMaquinaService aluguelMaquinaService
	
    static triggers = {
		cron name:'cronTrigger', startDelay:1000l, cronExpression: '0 16 1 * * ?'
     // simple repeatInterval: 5000l // execute job once in 5 seconds
    }

    def execute() {
		dpgService.expirarDPGsValidade()
		secUserService.atualizaStatusContas()
		aluguelMaquinaService.atualizaStatusAlugueis()
		alertaMaquinaService.criarAlertasManutencao()
    }
}
